
// Buffer用于接收和发送这些二进制数据流
// 例如,在上传或下载文件时,数据通常以二进制流的形式传输

let buf1 = Buffer.alloc(10)
console.log(buf1)

let buf2 = Buffer.allocUnsafe(30)
console.log(buf2)

let buf3 = Buffer.from('hello')
console.log(buf3)

let buf4 = Buffer.from([123, '数组', {aa: 'bb'}])
let buf4String = buf4.toString()
// console.log(buf4String)
// 打印出来的东西，看不懂

let buf5 = Buffer.from('hello')
console.log(buf5[0])
console.log(buf5.toString())
buf5[0] = 95
console.log(buf5.toString())
